<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>监听器</title>
</head>
<body>
<div id="app">

    {{fullName}}
    <input v-model="firstName"/>
    <input v-model="lastName"/>
</div>
</body>
<script src="../../lib/vue.js"></script>
<script>
/***
 * 1. 异步监听
* *
* */
    new Vue({
        el: '#app',
        data: {
            firstName: 'Mat',
            lastName: 'Green',
            fullName: '',
            message: 'hello',
            count: 0
        }, watch: {
            firstName(val) {
                this.fullName = val + this.lastName;
            }, lastName(val) {
                this.fullName = this.firstName + val;
            }
        }
    })

</script>
</html>